package main

import (
	"fmt"
	"sync"
	"time"
)

func main() {
	var lock sync.Mutex
	m := map[string]int{"a": 1, "b": 2, "c": 3}
	for i := 0; i < 1000; i++ {
		go func() {
			lock.Lock()
			for v := range m {
				m[v] = 100
			}
			lock.Unlock()
		}()
	}
	time.Sleep(time.Second)
	fmt.Println(m)
}
